Imports Microsoft.VisualBasic
Imports Oracle.DataAccess.Client
Imports Oracle.DataAccess.Types
Imports System.Data
Imports DataAccesGenerales
Imports DataAcces

Public Class DataAccesMigracion_SolicitudMultiple
  Private Const consTimeOut As Integer = 0 

    ''' <summary>
    ''' Funcion para Insertar un regristro en la tabla Migracion_SolicitudMultiple
    ''' </summary>
   Public Function Migracion_SolicitudMultiple_InsertarModificar(pniddocumento As Long, pnidtipodocmigracion As Long, pidbuque As Long, pbandera As String, pfechaatraque As String, pmuelleatraque As Long, pnidpuertoprocedencia As Long, pfechahoracita As String, plugarcita As String, pdiaspermanenciabuque As Long, pposicionbuque As String, ptiposervicio As String, pfecha_iniciaperiodo As String, pfecha_finperiodo As String, pobservaciones As String, pnidviaje As Long, pfoliomigracion As String, pvuelo As String, pfecha_vuelo As String, pnidpais_destino As Long, pnidpais_origen As Long, pexpediente As String, ptipobuque As String, pcompania As String, pclavepais As String, ppuertopartida As String, pfechapartida As String, ppuertoarribo As String, pfechaarribo As String, pitinerario As String) As Byte
        Dim pTransaccion As Byte = 0
        Dim mensaje As String = String.Empty
        Try
            Using oraConnection As New Oracle.DataAccess.Client.OracleConnection(ConfigurationManager.ConnectionStrings("EDIV2DESOraClient").ConnectionString)
                Using oraCommandDocumentos As New Oracle.DataAccess.Client.OracleCommand()
                    oraCommandDocumentos.Connection = oraConnection
                    oraCommandDocumentos.CommandTimeout = consTimeOut
                    oraCommandDocumentos.CommandType = CommandType.StoredProcedure
                    oraCommandDocumentos.CommandText = "EDIV2.?NomPaquete.Migracion_SolicitudMultipleInsertarModificar"
          oraCommandDocumentos.Parameters.Add("pniddocumento", pniddocumento)
          oraCommandDocumentos.Parameters.Add("pnidtipodocmigracion", pnidtipodocmigracion)
          oraCommandDocumentos.Parameters.Add("pidbuque", pidbuque)
          oraCommandDocumentos.Parameters.Add("pbandera", pbandera)
          oraCommandDocumentos.Parameters.Add("pfechaatraque", pfechaatraque)
          oraCommandDocumentos.Parameters.Add("pmuelleatraque", pmuelleatraque)
          oraCommandDocumentos.Parameters.Add("pnidpuertoprocedencia", pnidpuertoprocedencia)
          oraCommandDocumentos.Parameters.Add("pfechahoracita", pfechahoracita)
          oraCommandDocumentos.Parameters.Add("plugarcita", plugarcita)
          oraCommandDocumentos.Parameters.Add("pdiaspermanenciabuque", pdiaspermanenciabuque)
          oraCommandDocumentos.Parameters.Add("pposicionbuque", pposicionbuque)
          oraCommandDocumentos.Parameters.Add("ptiposervicio", ptiposervicio)
          oraCommandDocumentos.Parameters.Add("pfecha_iniciaperiodo", pfecha_iniciaperiodo)
          oraCommandDocumentos.Parameters.Add("pfecha_finperiodo", pfecha_finperiodo)
          oraCommandDocumentos.Parameters.Add("pobservaciones", pobservaciones)
          oraCommandDocumentos.Parameters.Add("pnidviaje", pnidviaje)
          oraCommandDocumentos.Parameters.Add("pfoliomigracion", pfoliomigracion)
          oraCommandDocumentos.Parameters.Add("pvuelo", pvuelo)
          oraCommandDocumentos.Parameters.Add("pfecha_vuelo", pfecha_vuelo)
          oraCommandDocumentos.Parameters.Add("pnidpais_destino", pnidpais_destino)
          oraCommandDocumentos.Parameters.Add("pnidpais_origen", pnidpais_origen)
          oraCommandDocumentos.Parameters.Add("pexpediente", pexpediente)
          oraCommandDocumentos.Parameters.Add("ptipobuque", ptipobuque)
          oraCommandDocumentos.Parameters.Add("pcompania", pcompania)
          oraCommandDocumentos.Parameters.Add("pclavepais", pclavepais)
          oraCommandDocumentos.Parameters.Add("ppuertopartida", ppuertopartida)
          oraCommandDocumentos.Parameters.Add("pfechapartida", pfechapartida)
          oraCommandDocumentos.Parameters.Add("ppuertoarribo", ppuertoarribo)
          oraCommandDocumentos.Parameters.Add("pfechaarribo", pfechaarribo)
          oraCommandDocumentos.Parameters.Add("pitinerario", pitinerario)

                    oraCommandDocumentos.Parameters.Add("pTransaccion", Oracle.DataAccess.Client.OracleDbType.Byte).Direction = ParameterDirection.Output
                    oraCommandDocumentos.Parameters.Add("pMensaje", Oracle.DataAccess.Client.OracleDbType.Varchar2, 200).Direction = ParameterDirection.Output

                    oraConnection.Open()
                    oraCommandDocumentos.ExecuteNonQuery()
                    pTransaccion = CByte(oraCommandDocumentos.Parameters("pTransaccion").Value.ToString())
                    mensaje = oraCommandDocumentos.Parameters("pMensaje").Value.ToString()
                    oraConnection.Close()
                End Using
            End Using
        Catch ex As Exception
            Throw ex
        End Try
        Return pTransaccion
    End Function
  
    ''' <summary>
    ''' Funcion para consultar un registro de la tabla Migracion_SolicitudMultiple
    ''' </summary>
    ''' <param name="pNidDocumento">numero de documento</param>
    ''' <returns>DataTable</returns>
    ''' <remarks></remarks>
   Public Function Migracion_SolicitudMultiple_Consultar(pNidDocumento As Long) As DataTable
        Dim dtResultado As New DataTable("Migracion_SolicitudMultipleConsulta")
        Try
            Using oraConnection As New Oracle.DataAccess.Client.OracleConnection(ConfigurationManager.ConnectionStrings("EDIV2DESOraClient").ConnectionString)
                Using oraCommandDocumentos As New Oracle.DataAccess.Client.OracleCommand()
                    oraCommandDocumentos.Connection = oraConnection
                    oraCommandDocumentos.CommandTimeout = consTimeOut
                    oraCommandDocumentos.CommandType = CommandType.StoredProcedure
                    oraCommandDocumentos.CommandText = "EDIV2.?NomPaquete.Migracion_SolicitudMultipleConsultar"
                    oraCommandDocumentos.Parameters.Add("pNidDocumento", pNidDocumento)
                    oraCommandDocumentos.Parameters.Add("pTransaccion", Oracle.DataAccess.Client.OracleDbType.Byte).Direction = ParameterDirection.Output
                    oraCommandDocumentos.Parameters.Add(New Oracle.DataAccess.Client.OracleParameter("pCursor", OracleDbType.RefCursor)).Direction = ParameterDirection.Output

                    Dim oraDataAdapter As New OracleDataAdapter(oraCommandDocumentos)
                    oraDataAdapter.Fill(dtResultado)
                    oraConnection.Close()
                End Using
            End Using
        Catch ex As Exception
            Throw ex
        End Try
        Return dtResultado
    End Function
  
    ''' <summary>
    ''' Funcion para generar la cadena XML Chilkat del documento de la tabla Migracion_SolicitudMultiple
    ''' </summary>
    ''' <param name="nidDocumento"> numero del documento</param>
    ''' <returns>Chilkat.Xml</returns>
    ''' <remarks></remarks>
   Public Function Migracion_SolicitudMultiple_CadenaOriginalXMLChilkat(nidDocumento As Long) As Chilkat.Xml
        Dim detalleDataSet As New DataSet("DatosMigracion_SolicitudMultiple")
        Try
      detalleDataSet = Migracion_SolicitudMultiple_DetalleXML(nidDocumento)
            'En esta parte van las tablas obtenidas en la consulta anterior
            'separadas dependiendo del reporte a crear, ejemplo:
            detalleDataSet.Tables(0).TableName = "Informacion del Tramite"
            detalleDataSet.Tables(1).TableName = "Datos Migracion_SolicitudMultiple"
            detalleDataSet.Tables(2).TableName = "Archivos Anexos"
            detalleDataSet.Tables(3).TableName = "Incidencias"

            Dim xml As New Chilkat.Xml
            xml.LoadXml(detalleDataSet.GetXml())
            Return xml 'detalleDataSet.GetXml()
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    ''' <summary>
    ''' Funcion para consultar el detalle del documento de la tabla Migracion_SolicitudMultiple
    ''' </summary>
    ''' <param name="pNidDocumento">numero del documento</param>
    ''' <returns>DataSet</returns>
    ''' <remarks></remarks>
   Public Function Migracion_SolicitudMultiple_DetalleXML(pNidDocumento As Long) As DataSet
        Dim dsDetalle As New DataSet("Migracion_SolicitudMultipleDetalle")
        Dim pTransaccion As Byte = 0
        Try
            Using oraConnection As New Oracle.DataAccess.Client.OracleConnection(ConfigurationManager.ConnectionStrings("EDIV2DESOraClient").ConnectionString)
                Using oraCommandDocumentos As New Oracle.DataAccess.Client.OracleCommand()
                    oraCommandDocumentos.Connection = oraConnection
                    oraCommandDocumentos.CommandTimeout = consTimeOut
                    oraCommandDocumentos.CommandType = CommandType.StoredProcedure
                    oraCommandDocumentos.CommandText = "EDIV2.?NomPaquete.Migracion_SolicitudMultipleDetalleXML"
                    oraCommandDocumentos.Parameters.Add("pNidDocumento", pNidDocumento)
                    oraCommandDocumentos.Parameters.Add("pTransaccion", Oracle.DataAccess.Client.OracleDbType.Byte).Direction = ParameterDirection.Output
                    'En esta parte es para los cursores necesario 
                    oraCommandDocumentos.Parameters.Add(New Oracle.DataAccess.Client.OracleParameter("pEncabezado", OracleDbType.RefCursor)).Direction = ParameterDirection.Output
                    oraCommandDocumentos.Parameters.Add(New Oracle.DataAccess.Client.OracleParameter("pDatos", OracleDbType.RefCursor)).Direction = ParameterDirection.Output
                    oraCommandDocumentos.Parameters.Add(New Oracle.DataAccess.Client.OracleParameter("pAnexos", OracleDbType.RefCursor)).Direction = ParameterDirection.Output
                    oraCommandDocumentos.Parameters.Add(New Oracle.DataAccess.Client.OracleParameter("pIncidencias", OracleDbType.RefCursor)).Direction = ParameterDirection.Output

                    Dim oraDataAdapter As New OracleDataAdapter(oraCommandDocumentos)
                    'pTransaccion = CByte(oraCommandDocumentos.Parameters("pTransaccion").Value.ToString())
                    oraDataAdapter.Fill(dsDetalle)
                End Using
            End Using
        Catch ex As Exception
            Throw ex
        End Try
        Return dsDetalle
    End Function
  
   Public Function Migracion_SolicitudMultiple_DatosBase() As DataTable
        Dim dtResultado As New DataTable("Migracion_SolicitudMultipleConsulta")
        Try
            Using oraConnection As New Oracle.DataAccess.Client.OracleConnection(ConfigurationManager.ConnectionStrings("EDIV2DESOraClient").ConnectionString)
                Using oraCommandDocumentos As New Oracle.DataAccess.Client.OracleCommand()
                    oraCommandDocumentos.Connection = oraConnection
                    oraCommandDocumentos.CommandTimeout = consTimeOut
                    oraCommandDocumentos.CommandType = CommandType.StoredProcedure
                    oraCommandDocumentos.CommandText = "EDIV2.?NomPaquete.Migracion_SolicitudMultipleDatosBase"
                    oraCommandDocumentos.Parameters.Add("pTransaccion", Oracle.DataAccess.Client.OracleDbType.Byte).Direction = ParameterDirection.Output
                    oraCommandDocumentos.Parameters.Add(New Oracle.DataAccess.Client.OracleParameter("pCursor", OracleDbType.RefCursor)).Direction = ParameterDirection.Output

                    Dim oraDataAdapter As New OracleDataAdapter(oraCommandDocumentos)
                    oraDataAdapter.Fill(dtResultado)
                    oraConnection.Close()
                End Using
            End Using
        Catch ex As Exception
            Throw ex
        End Try
        Return dtResultado
    End Function
  
    ''' <summary>
    ''' Funcion para Insertar un regristro en la tabla Migracion_SolicitudMultiple
    ''' </summary>
   Public Function Migracion_SolicitudMultiple_Insertar(pniddocumento As Long, pnidtipodocmigracion As Long, pidbuque As Long, pbandera As String, pfechaatraque As String, pmuelleatraque As Long, pnidpuertoprocedencia As Long, pfechahoracita As String, plugarcita As String, pdiaspermanenciabuque As Long, pposicionbuque As String, ptiposervicio As String, pfecha_iniciaperiodo As String, pfecha_finperiodo As String, pobservaciones As String, pnidviaje As Long, pfoliomigracion As String, pvuelo As String, pfecha_vuelo As String, pnidpais_destino As Long, pnidpais_origen As Long, pexpediente As String, ptipobuque As String, pcompania As String, pclavepais As String, ppuertopartida As String, pfechapartida As String, ppuertoarribo As String, pfechaarribo As String, pitinerario As String) As Byte
        Dim pTransaccion As Byte = 0
        Dim mensaje As String = String.Empty
        Try
            Using oraConnection As New Oracle.DataAccess.Client.OracleConnection(ConfigurationManager.ConnectionStrings("EDIV2DESOraClient").ConnectionString)
                Using oraCommandDocumentos As New Oracle.DataAccess.Client.OracleCommand()
                    oraCommandDocumentos.Connection = oraConnection
                    oraCommandDocumentos.CommandTimeout = consTimeOut
                    oraCommandDocumentos.CommandType = CommandType.StoredProcedure
                    oraCommandDocumentos.CommandText = "EDIV2.?NomPaquete.Migracion_SolicitudMultipleInsertar"
          oraCommandDocumentos.Parameters.Add("pniddocumento", pniddocumento)
          oraCommandDocumentos.Parameters.Add("pnidtipodocmigracion", pnidtipodocmigracion)
          oraCommandDocumentos.Parameters.Add("pidbuque", pidbuque)
          oraCommandDocumentos.Parameters.Add("pbandera", pbandera)
          oraCommandDocumentos.Parameters.Add("pfechaatraque", pfechaatraque)
          oraCommandDocumentos.Parameters.Add("pmuelleatraque", pmuelleatraque)
          oraCommandDocumentos.Parameters.Add("pnidpuertoprocedencia", pnidpuertoprocedencia)
          oraCommandDocumentos.Parameters.Add("pfechahoracita", pfechahoracita)
          oraCommandDocumentos.Parameters.Add("plugarcita", plugarcita)
          oraCommandDocumentos.Parameters.Add("pdiaspermanenciabuque", pdiaspermanenciabuque)
          oraCommandDocumentos.Parameters.Add("pposicionbuque", pposicionbuque)
          oraCommandDocumentos.Parameters.Add("ptiposervicio", ptiposervicio)
          oraCommandDocumentos.Parameters.Add("pfecha_iniciaperiodo", pfecha_iniciaperiodo)
          oraCommandDocumentos.Parameters.Add("pfecha_finperiodo", pfecha_finperiodo)
          oraCommandDocumentos.Parameters.Add("pobservaciones", pobservaciones)
          oraCommandDocumentos.Parameters.Add("pnidviaje", pnidviaje)
          oraCommandDocumentos.Parameters.Add("pfoliomigracion", pfoliomigracion)
          oraCommandDocumentos.Parameters.Add("pvuelo", pvuelo)
          oraCommandDocumentos.Parameters.Add("pfecha_vuelo", pfecha_vuelo)
          oraCommandDocumentos.Parameters.Add("pnidpais_destino", pnidpais_destino)
          oraCommandDocumentos.Parameters.Add("pnidpais_origen", pnidpais_origen)
          oraCommandDocumentos.Parameters.Add("pexpediente", pexpediente)
          oraCommandDocumentos.Parameters.Add("ptipobuque", ptipobuque)
          oraCommandDocumentos.Parameters.Add("pcompania", pcompania)
          oraCommandDocumentos.Parameters.Add("pclavepais", pclavepais)
          oraCommandDocumentos.Parameters.Add("ppuertopartida", ppuertopartida)
          oraCommandDocumentos.Parameters.Add("pfechapartida", pfechapartida)
          oraCommandDocumentos.Parameters.Add("ppuertoarribo", ppuertoarribo)
          oraCommandDocumentos.Parameters.Add("pfechaarribo", pfechaarribo)
          oraCommandDocumentos.Parameters.Add("pitinerario", pitinerario)

                    oraCommandDocumentos.Parameters.Add("pTransaccion", Oracle.DataAccess.Client.OracleDbType.Byte).Direction = ParameterDirection.Output
                    oraCommandDocumentos.Parameters.Add("pMensaje", Oracle.DataAccess.Client.OracleDbType.Varchar2, 200).Direction = ParameterDirection.Output

                    oraConnection.Open()
                    oraCommandDocumentos.ExecuteNonQuery()
                    pTransaccion = CByte(oraCommandDocumentos.Parameters("pTransaccion").Value.ToString())
                    mensaje = oraCommandDocumentos.Parameters("pMensaje").Value.ToString()
                    oraConnection.Close()
                End Using
            End Using
        Catch ex As Exception
            Throw ex
        End Try
        Return pTransaccion
    End Function

    ''' <summary>
    ''' Funcion para Modificar un regristro en la tabla Migracion_SolicitudMultiple
    ''' </summary>
   Public Function Migracion_SolicitudMultiple_Modificar(pniddocumento As Long, pnidtipodocmigracion As Long, pidbuque As Long, pbandera As String, pfechaatraque As String, pmuelleatraque As Long, pnidpuertoprocedencia As Long, pfechahoracita As String, plugarcita As String, pdiaspermanenciabuque As Long, pposicionbuque As String, ptiposervicio As String, pfecha_iniciaperiodo As String, pfecha_finperiodo As String, pobservaciones As String, pnidviaje As Long, pfoliomigracion As String, pvuelo As String, pfecha_vuelo As String, pnidpais_destino As Long, pnidpais_origen As Long, pexpediente As String, ptipobuque As String, pcompania As String, pclavepais As String, ppuertopartida As String, pfechapartida As String, ppuertoarribo As String, pfechaarribo As String, pitinerario As String) As Byte
        Dim pTransaccion As Byte = 0
        Dim mensaje As String = String.Empty
        Try
            Using oraConnection As New Oracle.DataAccess.Client.OracleConnection(ConfigurationManager.ConnectionStrings("EDIV2DESOraClient").ConnectionString)
                Using oraCommandDocumentos As New Oracle.DataAccess.Client.OracleCommand()
                    oraCommandDocumentos.Connection = oraConnection
                    oraCommandDocumentos.CommandTimeout = consTimeOut
                    oraCommandDocumentos.CommandType = CommandType.StoredProcedure
                    oraCommandDocumentos.CommandText = "EDIV2.?NomPaquete.Migracion_SolicitudMultipleModificar"
          oraCommandDocumentos.Parameters.Add("pniddocumento", pniddocumento)
          oraCommandDocumentos.Parameters.Add("pnidtipodocmigracion", pnidtipodocmigracion)
          oraCommandDocumentos.Parameters.Add("pidbuque", pidbuque)
          oraCommandDocumentos.Parameters.Add("pbandera", pbandera)
          oraCommandDocumentos.Parameters.Add("pfechaatraque", pfechaatraque)
          oraCommandDocumentos.Parameters.Add("pmuelleatraque", pmuelleatraque)
          oraCommandDocumentos.Parameters.Add("pnidpuertoprocedencia", pnidpuertoprocedencia)
          oraCommandDocumentos.Parameters.Add("pfechahoracita", pfechahoracita)
          oraCommandDocumentos.Parameters.Add("plugarcita", plugarcita)
          oraCommandDocumentos.Parameters.Add("pdiaspermanenciabuque", pdiaspermanenciabuque)
          oraCommandDocumentos.Parameters.Add("pposicionbuque", pposicionbuque)
          oraCommandDocumentos.Parameters.Add("ptiposervicio", ptiposervicio)
          oraCommandDocumentos.Parameters.Add("pfecha_iniciaperiodo", pfecha_iniciaperiodo)
          oraCommandDocumentos.Parameters.Add("pfecha_finperiodo", pfecha_finperiodo)
          oraCommandDocumentos.Parameters.Add("pobservaciones", pobservaciones)
          oraCommandDocumentos.Parameters.Add("pnidviaje", pnidviaje)
          oraCommandDocumentos.Parameters.Add("pfoliomigracion", pfoliomigracion)
          oraCommandDocumentos.Parameters.Add("pvuelo", pvuelo)
          oraCommandDocumentos.Parameters.Add("pfecha_vuelo", pfecha_vuelo)
          oraCommandDocumentos.Parameters.Add("pnidpais_destino", pnidpais_destino)
          oraCommandDocumentos.Parameters.Add("pnidpais_origen", pnidpais_origen)
          oraCommandDocumentos.Parameters.Add("pexpediente", pexpediente)
          oraCommandDocumentos.Parameters.Add("ptipobuque", ptipobuque)
          oraCommandDocumentos.Parameters.Add("pcompania", pcompania)
          oraCommandDocumentos.Parameters.Add("pclavepais", pclavepais)
          oraCommandDocumentos.Parameters.Add("ppuertopartida", ppuertopartida)
          oraCommandDocumentos.Parameters.Add("pfechapartida", pfechapartida)
          oraCommandDocumentos.Parameters.Add("ppuertoarribo", ppuertoarribo)
          oraCommandDocumentos.Parameters.Add("pfechaarribo", pfechaarribo)
          oraCommandDocumentos.Parameters.Add("pitinerario", pitinerario)

                    oraCommandDocumentos.Parameters.Add("pTransaccion", Oracle.DataAccess.Client.OracleDbType.Byte).Direction = ParameterDirection.Output
                    oraCommandDocumentos.Parameters.Add("pMensaje", Oracle.DataAccess.Client.OracleDbType.Varchar2, 200).Direction = ParameterDirection.Output

                    oraConnection.Open()
                    oraCommandDocumentos.ExecuteNonQuery()
                    pTransaccion = CByte(oraCommandDocumentos.Parameters("pTransaccion").Value.ToString())
                    mensaje = oraCommandDocumentos.Parameters("pMensaje").Value.ToString()
                    oraConnection.Close()
                End Using
            End Using
        Catch ex As Exception
            Throw ex
        End Try
        Return pTransaccion
    End Function
  
    ''' <summary>
    ''' Funcion para generar un combo de la tabla Migracion_SolicitudMultiple
    ''' </summary>
    ''' <param name="pNombre">nombre a buscar en la tabla</param>
    ''' <returns>DataTable</returns>
    ''' <remarks>si el nombre es "" retornara todos los registros</remarks>
   Public Function Migracion_SolicitudMultiple_Combo(pNombre As String) As DataTable
        Dim dtResultado As New DataTable("Migracion_SolicitudMultipleCombo")
        Try
            Using oraConnection As New Oracle.DataAccess.Client.OracleConnection(ConfigurationManager.ConnectionStrings("EDIV2DESOraClient").ConnectionString)
                Using oraCommandDocumentos As New Oracle.DataAccess.Client.OracleCommand()
                    oraCommandDocumentos.Connection = oraConnection
                    oraCommandDocumentos.CommandTimeout = consTimeOut
                    oraCommandDocumentos.CommandType = CommandType.StoredProcedure
                    oraCommandDocumentos.CommandText = "EDIV2.?NomPaquete.Migracion_SolicitudMultipleCombo"
                    oraCommandDocumentos.Parameters.Add("pNombre", pNombre)
                    oraCommandDocumentos.Parameters.Add("pTransaccion", Oracle.DataAccess.Client.OracleDbType.Byte).Direction = ParameterDirection.Output
                    oraCommandDocumentos.Parameters.Add(New Oracle.DataAccess.Client.OracleParameter("pCursor", OracleDbType.RefCursor)).Direction = ParameterDirection.Output

                    Dim oraDataAdapter As New OracleDataAdapter(oraCommandDocumentos)
                    oraDataAdapter.Fill(dtResultado)
                    oraConnection.Close()
                End Using
            End Using
        Catch ex As Exception
            Throw ex
        End Try
        Return dtResultado
    End Function
  
    ''' <summary>
    ''' Funcion para generar la integracion del documento de la tabla Migracion_SolicitudMultiple
    ''' </summary>
    ''' <param name="pNidDocumento">numero del documento</param>
    ''' <returns>Byte</returns>
    ''' <remarks></remarks>
   Public Function Migracion_SolicitudMultiple_Integracion(pNidDocumento As Long) As Byte
        Dim pTransaccion As Byte = 0
        Dim mensaje As String = String.Empty
        Try
            Using oraConnection As New Oracle.DataAccess.Client.OracleConnection(ConfigurationManager.ConnectionStrings("EDIV2DESOraClient").ConnectionString)
                Using oraCommandDocumentos As New Oracle.DataAccess.Client.OracleCommand()
                    oraCommandDocumentos.Connection = oraConnection
                    oraCommandDocumentos.CommandTimeout = consTimeOut
                    oraCommandDocumentos.CommandType = CommandType.StoredProcedure
                    oraCommandDocumentos.CommandText = "EDIV2.?NomPaquete.Migracion_SolicitudMultipleIntegracion"
                    oraCommandDocumentos.Parameters.Add("pNidDocumento", pNidDocumento)
                    oraCommandDocumentos.Parameters.Add("pTransaccion", Oracle.DataAccess.Client.OracleDbType.Byte).Direction = ParameterDirection.Output
                    oraCommandDocumentos.Parameters.Add("pMensaje", Oracle.DataAccess.Client.OracleDbType.Varchar2, 200).Direction = ParameterDirection.Output

                    oraConnection.Open()
                    oraCommandDocumentos.ExecuteNonQuery()
                    pTransaccion = CByte(oraCommandDocumentos.Parameters("pTransaccion").Value.ToString())
                    mensaje = oraCommandDocumentos.Parameters("pMensaje").Value.ToString()
                    oraConnection.Close()
                End Using
            End Using
        Catch ex As Exception
            Throw ex
        End Try
        Return pTransaccion
    End Function
  
   Public Function Migracion_SolicitudMultiple_Borrar(pnid As Long) As Byte
        Dim pTransaccion As Byte = 0
        Dim mensaje As String = String.Empty
        Try
            Using oraConnection As New Oracle.DataAccess.Client.OracleConnection(ConfigurationManager.ConnectionStrings("EDIV2DESOraClient").ConnectionString)
                Using oraCommandDocumentos As New Oracle.DataAccess.Client.OracleCommand()
                    oraCommandDocumentos.Connection = oraConnection
                    oraCommandDocumentos.CommandTimeout = consTimeOut
                    oraCommandDocumentos.CommandType = CommandType.StoredProcedure
                    oraCommandDocumentos.CommandText = "EDIV2.?NomPaquete.Migracion_SolicitudMultipleBorrar"
                    oraCommandDocumentos.Parameters.Add("pnid", pnid)
                    oraCommandDocumentos.Parameters.Add("pTransaccion", Oracle.DataAccess.Client.OracleDbType.Byte).Direction = ParameterDirection.Output

                    oraConnection.Open()
                    oraCommandDocumentos.ExecuteNonQuery()
                    pTransaccion = CByte(oraCommandDocumentos.Parameters("pTransaccion").Value.ToString())
                    oraConnection.Close()
                End Using
            End Using
        Catch ex As Exception
            Throw ex
        End Try
        Return pTransaccion
    End Function
  
  
End Class
